<!DOCTYPE HTML>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	  <link rel="shortcut icon" href="<{$siteurl}>/upload/favicon/favicon-16x16.png" type="image/png" />
    <link rel="icon" href="<{$siteurl}>/upload/favicon/favicon-16x16.png" type="image/png" sizes="16x16" />
    <link rel="icon" href="<{$siteurl}>/upload/favicon/favicon-32x32.png" type="image/png" sizes="32x32" />
    <link rel="icon" href="<{$siteurl}>/upload/favicon/favicon-48x48.png" type="image/png" sizes="48x48" />
    <link rel="icon" href="<{$siteurl}>/upload/favicon/favicon-64x64.png" type="image/png" sizes="64x64" />
      <title><{$sitename}></title>    
	<{block name="seokey"}><meta name="Keywords" content="<{$keywords}>" /><{/block}>
<{block name="seodes"}><meta name="description" content="<{$description}>" /><{/block}>
<{$metadata|stripslashes}> 
 <script> 
	var siteurl = "<{$siteurl}>";
	var is_static ="<{$is_static}>";
	var controllername= '<{$controlname}>';
</script>
<link rel="stylesheet" href="<{$siteurl}>/templates/<{$tempdir}>/public/mnew7/css/map-n.css" />
<!-- <link rel="stylesheet" href="<{$siteurl}>/templates/<{$tempdir}>/public/mnew7/js/areamap.js" /> -->
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=<{$baidumapkey}>"></script>
<script src="<{$siteurl}>/templates/<{$tempdir}>/public/js/jquerynew.js" type="text/javascript" language="javascript"></script>
 <script src="<{$siteurl}>/templates/<{$tempdir}>/public/js/allj.js" type="text/javascript" language="javascript"></script>


	</head>
	<body style="overflow:auto;background:none;">
 <style>

 .guideTop{width:100%; height:80px;background:#ec5e5d;}
.guideContent{ width:1200px; margin:0 auto;}
.guideContent a img{ width:165px; height:55px;  float:left;   margin-top: 13px;}
.mmeberinfo{ float:right;}
.mmeberinfo li{ color:#fff;  font-size:16px; float:left; margin-left:15px; height:80px; line-height:80px;}
.mmeberinfo li a{ color:#fff;  font-size:16px;  height:80px; line-height:80px;}
.guidebox{  background: url(<{$siteurl}>/upload/images/landing_bg_1e47940.png); background-size:100% 100%; }
 </style>
<div class="guideTop">
	<div class="guideContent">
		<a href="<{$siteurl}>" >
			<img src="<{$sitelogo}>" />
		</a>
		<div class="mmeberinfo">
			<ul>
			 
		 <{if !empty($member['uid'])}>   
		 
		 <li><a  target="_bank" href="<{ofunc type=url link="/member/base"}>" >你好，<{$member['username']}></a></li> 
				<li style="width:2px;">|</li>
				<li><a  target="_bank" href="<{ofunc type=url link="/member/loginout"}>" >退出</a></li>
		 
		   <{else}>
				<li><a  target="_bank" href="<{ofunc type=url link="/member/login"}>" >登录</a></li> 
				<li style="width:2px;">|</li>
				<li><a target="_bank" href="<{ofunc type=url link="/member/regester"}>" >注册</a></li>
		
		<{/if}> 
			</ul>
		</div>
	</div>
</div>
  
  <div class="guidebox"style="position:relative; height:480px;">
<div class="map" id="map">
  <div class="top">
    
    <div class="guider" style="visibility: visible;height:110px ;width:550px; "id="guider">
   <img src="<{$siteurl}>/upload/images/guideBg.png" /> 
    </div>
     <div class="address clearfix" id="address" style="position:relative;" > <!--  position: absolute; top: 0px; left: 0px; -->
      <div class="fr history-address m-shadow">
        <a id="historylist" href="javascript:;" title="历史地址">
          <span>历史地址</span>
          <i class="i-triangle-down"></i>
        </a>
       
	   
	   <div class="dialog dialog-historyaddr" style="display: none;">  <div class="map-dialog" style="left:750px; top: 75px;">    
	   <i class="icon i-mapdialog-arr" style="left: 25px;"></i>   

	<{if empty($cookmalist)}>
	   
	   <div class="content" style="width: 150px;"><div class="address-warp">
	   <ul>      
	  
				  <li class="empty">暂无历史地址</li>  
	     	
	   
	  </ul></div></div>  
	  
	  <{else}>
	  
		<div class="content">
		<div class="address-warp">
	
		<ul>     
		<{foreach from=$cookmalist key=myid item=items}>
		 <{if $myid <= 5 && !empty($items)}>
<a  style="width:240px; font-size:14px; color:#000000; height:50px; line-height:50px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    outline: 0!important; background:#fff; border-bottom: 1px solid #DEDEDE;"  class="name first" href="<{ofunc type=url link="/site/setuserlng/lng/<{$cooklnglist[$myid]|default:'0'}>/lat/<{$cooklatlist[$myid]|default:'0'}>/mapname/<{$items}>"}>" title="<{$items}>">
			 <li style="padding:0px 10px;" class=""><{$items}></li>
			 </a>
 <{/if}>		 
		 <{/foreach}>
		</ul>
		
		</div></div>
	  
	  <{/if}>
	  
	  </div></div>
	   
	   
      </div>
      <div class="fl current-city m-shadow">
        <a href="javascript:;" class="city" id="citylist" data-ispoi="1" data-cid="410100">
          <span>
            <{$cityname}>
          </span>
         </a>
      </div>
      <div class="fl address-input">
        <div class="input-container clearfix m-shadow">
          <input type="text" id="searchKeywords" placeholder="输入地址搜索周边商家" class="fl" />
		    <input type="hidden" name="cityname" id="cityname" value="<{$cityname}>">
                     <input type="hidden"  name="surec" value="1"> 
          <a href="javascript:;" class="fl" id="search">搜索</a>
        </div>
      </div>
    </div>
  </div>
  
  
  <div class="result hidden jspScrollable" id="search_result" style="overflow: hidden; padding: 0px; height: 100%; width: 300px;">
		<div class="jspContainer" style="width: 300px; height: 280px;"><div class="jspPane" style="padding: 0px; top: 0px; left: 0px; width: 300px;"><div class="loading"></div></div></div>
 </div>
  
  <div class="container hidden" id="bd-map" style="overflow: hidden; position: relative; z-index: 0; color: rgb(0, 0, 0); text-align: left; background-color: rgb(243, 241, 236);">
  
  </div>
  
   
  

</div>
</div>
 



 <div style=" display:;">
<div style="height:370px;   background:#fff; text-align:center;">
	<img style="padding-top:56px;" src="<{$siteurl}>/upload/images/guide_zhiyin.png" />
</div>

<div class="app-down" id="moui_1439793922133">
            <div class="inner" id="moui_1439793922132">
                <div class="app-phone" id="moui_1439793922160"></div>
                 <div class="app-code">
                  <div style="float:left;">
                   <P> <img style="width:124px; height:124px;" src="<{$siteurl}>/upload/app/m6wx_ewm.png" alt=""></P>
					<p style="width:124px; color:#fff; text-align:center; margin-top:5px;">微信端扫描二维码</p>
				</div>
				 <div  style="float:left; margin-left:20px;">
                   <P> <img style="width:124px; height:124px;" src="<{$siteurl}>/upload/app/m6app_ewm.png" alt=""></P>
					<p style="width:124px; color:#fff; text-align:center; margin-top:5px;">手机客户端下载</p>
				</div>
                </div>
            </div>
        </div>
		


<style>
.app-down {
  width: 100%;
  height: 352px;
  margin-top: 0px;
  background: url(<{$siteurl}>/upload/images/app-bg.png) repeat-x center top;
}
.app-down .inner {
  position: relative;
  width: 1135px;
  height: 100%;
  margin: 0 auto;
  text-align: left;
}
.app-down .inner .app-phone {
  position: absolute;
     left: -34px;
    bottom: -66px;
  width: 197px;
  height: 376px;
  background: url(<{$siteurl}>/upload/images/app-android.png) no-repeat center top;
}
.app-down .inner .app-instro {
  position: absolute;
  left: 235px;
  bottom: 5px;
  width: 523px;
  height: 289px;
  background: url(<{$siteurl}>/templates/<{$tempdir}>/public/images/appinstro.png) no-repeat center top;
}
.app-down .inner .app-code {
  position: absolute;
  right: 0;
  bottom: 18%;
}
app-down .inner .app-code .download {
  float: left;
  margin-right: 16px;
}


.guidefooter{ height:158px; background:url(<{$siteurl}>/templates/<{$tempdir}>/public/images/guidefooterBg.png) repeat; text-align:center;}
.guidefooter p,.guidefooter p a{  color:#fff;  font-size:17px;  }
.guidefooter .footlink{ padding-top:50px;}
.guidefooter .Copyright{ margin-top:36px;}
</style>



<div style="clear:both;"></div>

<div class="guidefooter">

	  <P class="footlink" >
			     <{if !empty($toplink)}>
	 	     	<{$toplink = $toplink|unserialize}>
       <{foreach from=$toplink key=myid item=items name=listname}> 
			        
					   <a href="<{$items['typeurl']}>" class=""  data="<{$items['typeurl']}>"><span style="line-height:16px;"><{$items['typename']}></span>
					   <{if !$smarty.foreach.listname.last}><span> &nbsp;&nbsp;|&nbsp;&nbsp; </span><{/if}>
					   </a> 
		  <{/foreach}>
		  <{/if}>
         	
			  
			  </P>
			  <P class="Copyright">Copyright©2015 <{$sitename}>  | <{$beian}>   <{$footerdata|stripslashes}> </P>
</div>
</div>



<div class="mask" style="display:none;"></div>
<div class="dialog dialog-failed" style="display: none;">     
	<table class="simple-dialog" style="left: 734px; top: 190px;">    
		<tbody>      
			<tr>        
				<td class="top-left"></td>       
				<td class="top-center"></td>        
				<td class="top-right"></td>      
			</tr>      
			<tr>       
				<td class="middle-left"></td>       
				<td class="middle-center">         
					<div class="dialog-main">                       
						<a href="javascript:;" class="notitle-close fr"><i class="icon i-cross"></i></a>                        
						<div class="content"><i class="icon i-dialog-wrong"></i><span class="tips">请输入您的送餐地址！</span></div>          
					</div>       
				</td>       
				<td class="middle-right"></td>      
			</tr>      
			<tr>        
				<td class="bottom-left"></td>       
				<td class="bottom-center"></td>        
				<td class="bottom-right"></td>      
			</tr>    
		</tbody>  
	</table>
</div>


	<script>
var biaoqianval = false;
function bqzhi(){
	biaoqianval  = false;
}
	
		var map = new BMap.Map("bd-map");  


var myIcon1 = new BMap.Icon(siteurl+"/upload/map/pepole.png", new BMap.Size(75,75),{offset: new BMap.Size(25,25),imageOffset: new BMap.Size(25,25)});  
var marker = null;   
var infoWindow = new BMap.InfoWindow('');  // 创建信息窗口对象
var makenow = false;
var markerslist = null;

map.setDefaultCursor("url('upload/shop/add-my-shubiao.cur'),default");
map.setDraggingCursor("auto"); 
//加载缩放级别

map.addControl(new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL}));  //右上角，仅包含平移和缩放按钮

var savemapurl = '<{ofunc type=url link="/site/setuserlng/mapname/@mapname@/lat/@lat@/lng/@lng@/random/@random@"}>';  
map.enableContinuousZoom();//可缩放

	
	// 百度地图API功能

		map.enableScrollWheelZoom(); 
		map.enableContinuousZoom(); 
	
	
	// 创建Map实例
	//map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
	map.centerAndZoom("<{$cityname}>",15);
	
	$("#tipclose").click(function(){
		$("#guider .bg").hide();
	});
	$(".notitle-close").click(function(){
		$(".dialog-failed").hide();
			$(".mask").hide();
	});
	$("#searchKeywords").focus(function(){
		$("#guider .bg").addClass('search');
	
	//	alert(0);
		
	});
	
	
	$("#search").click(function(){
		$("#tangram-suggestion--TANGRAM__2-main").hide();
		var searchval = $("#searchKeywords").val();
		if( searchval == '' ){
			$(".dialog-failed").show();
			$(".mask").show();
		}else{
			$("#guider").hide();
			//position: absolute; top: 0px; left: 0px;
			$("#address").css("position","absolute");
			$("#address").animate({top:"0px",left:"0px"}, 'slow');			
			$("#search_result").removeClass("hidden");
			$("#bd-map").removeClass("hidden");
			//local.search(searchval);
				$("#tangram-suggestion--TANGRAM__2-main").css("top","230px");
				$("#tangram-suggestion--TANGRAM__2-main").css("left","353px");
				$(".map").css('height','600px');
				$(".guidebox").css('height','850px');
			dosearchmap(0);
		}
	});

function dosearchmap(pagenum){

 
	   //调用搜索
	   map.clearOverlays();
	   var  tempurlss = siteurl+'/index.php?ctrl=site&action=ajaxbaidu&random=@random@';  //  searchvalue  cityname
	   var searchvalue = $('#searchKeywords').val();
	   var cityname = $('#cityname').val();
	  $.ajax({
     type: 'post',
     async:false,
     data:{'searchvalue':searchvalue,'cityname':cityname,'pagenum':pagenum},
     url: tempurlss.replace('@random@', 1+Math.round(Math.random()*1000)), 
     dataType: 'script',success: function(content) {    
	 
		//searchbackdata(content);
		
		 },
      error: function(content) { 
       	alert('选择的城市不满足百度地图搜索条件'); 
	    }
     });   
	   
 
  return false;
}
function searchbackdata(datas){  
 //alert(datas.total);
 //alert(datas.pagenum);
	if(datas.status == 0){
	      miaodian(datas.results,datas.total);
	      makedivpage(datas.total,datas.pagenum);
	}
 // alert(datas.length);
}	

/*构造搜索*/
 var markerslist = null;
 	 
function miaodian(datas,shuliang){


	markerslist=new Array();
	$('#search_result').html('');
	var  wordearray = ['A','B','C','D','E','F','G','H','I','J','K','L','M'];
	makenow = false;
	 var tempoint;
	 $('#search_result').append('<div class="jspContainer" style="width: 300px;overflow-y:auto; height: 100%;"><div class="jspPane" style="padding: 0px; top: 0px; left: 0px; width: 278px;"><div class="total-addr">共<span>'+shuliang+'</span>地址</div><ul> </ul><div class="pager"> </div></div></div>  ');
	 $.each(datas, function(i,val){  
	 //alert(val.location.lng);
	 
         		    	   if(i == 0){  
         		    	        tempoint =   new BMap.Point(val.location.lng,val.location.lat);//imageOffset: new BMap.Size(-32,0 - i * 46)}
         		    	        map.centerAndZoom(tempoint,map.getZoom()); 
         		    	   } 
                     var icon = new BMap.Icon("/upload/map/mapIcon.png", new BMap.Size(90,44),{offset: new BMap.Size(45,46),imageOffset: new BMap.Size(-32,0 - i * 47)});//infoWindowAnchor:new BMap.Size(33,44),offset:new BMap.Size(0,0)}
         		         var mkr = new BMap.Marker(new BMap.Point(val.location.lng,val.location.lat), {icon: icon});  
         		        var temp_linksss = savemapurl.replace('@lat@',val.location.lat).replace('@lng@', val.location.lng).replace('@mapname@', encodeURI(val.name)); 
         		         var contentm = '<p class="infoTitle">'+val.name+'</p><p class="infoAddress">'+val.address+'</p><p class="nearshop">附近共有<span class="shopnum"> '+val.shuliang+' </span>家商家</p>';
         		         if(val.shuliang > 0){
         		            contentm += '<a href="'+temp_linksss+'" class="mapBtns">查看商家</a>';
         		         }
         		       
         		    	   var infoWindow2 = new BMap.InfoWindow(contentm); 
                     markerslist.push(infoWindow2);
                     mkr.addEventListener("click", function(){  this.openInfoWindow(infoWindow2);});
					 
					//  map.openInfoWindow(markerslist[checkobj],tempoint);  
					 // map.centerAndZoom(tempoint,map.getZoom()); 
					  
                     map.addOverlay(mkr);  
					 $('#search_result .jspContainer ul').append('<li lng="'+ val.location.lng+'" lat="'+ val.location.lat+'" index="'+i+'" class="field"><div class="poi sprite fl">'+wordearray[i]+'</div><div class="content"><div class="title">'+val.name+'</div><div class="addr">地址：'+val.address+'</div> <div class="nearby">附近有<span>'+val.shuliang+'</span>家商家</div></div></li>  ');
           
   });  
  if( markerslist.length > 0 ){
		map.openInfoWindow(markerslist[0],tempoint);  
		map.centerAndZoom(tempoint,map.getZoom());
		$("#search_result .jspContainer li:first").addClass("first-field");
		$("#search_result .jspContainer li:first").addClass("active");
  }else{
	$('#search_result .jspContainer ul').append('<div class="no-address">  <div class="text">未找到相关地址：</div>  <p>1.请核对地址拼写正确。</p>  <p>2.请尝试其他关键字。</p></div> ');
  
  }

}
function makedivpage(shuliang,pagenum){
	var pagesize = 12;
	var pageall = shuliang/pagesize > parseInt(shuliang/pagesize) ?parseInt(shuliang/12)+1:parseInt(shuliang/12);
   var gotopage = 0;
   //<a data-page="1" href="javascript:;" class="active">1</a>   
	 if(pagenum != 0){
	 	    gotopage = Number(pagenum)-1;
	      $('#search_result .pager').append('<a  onclick="dosearchmap('+gotopage+');" data-page="'+gotopage+'" href="javascript:;" class="active">&lt;</a>');
	 } 
	var tempage = pageall > 10?10:pageall;
	 for(var i=0;i<tempage;i++){
	 	var c = i+1;
	 	   if(i == pagenum){
	 	   	   
	 	       $('#search_result .pager').append('<a  onclick="dosearchmap('+i+');" data-page="'+i+'" href="javascript:;" class="active">'+c+'</a>');
	 	   }else{
	 	   	
	 	   	 $('#search_result .pager').append('<a  onclick="dosearchmap('+i+');" data-page="'+i+'" href="javascript:;" >'+c+'</a>'); 
	 	   }
	 } 
	 if(pagenum != pageall){
	 	   gotopage = Number(pagenum)+1;
	    $('#search_result .pager').append('<a data-page="'+gotopage+'"  onclick="dosearchmap('+gotopage+');"  href="javascript:;" >&gt;</a>'); //每页12个  
	 }
}
$('#search_result  .jspContainer li').live("click", function() {    
	$(this).addClass('active').siblings().removeClass('active');
	
	var checkobj = $(this).attr('index');
	if(checkobj != undefined){
	     var tempoint =   new BMap.Point($(this).attr('lng'),$(this).attr('lat'));//imageOffset: new BMap.Size(-32,0 - i * 46)}
	      map.openInfoWindow(markerslist[checkobj],tempoint);  
        map.centerAndZoom(tempoint,map.getZoom()); 
	}
});






map.addEventListener("click",function(e){    

	if(e.overlay == null){ 		
			if(biaoqianval == false){
				biaoqianval  = true;

					 setTimeout("bqzhi()", 500 ); 
					
						 var url = siteurl+'/index.php?ctrl=site&action=ajaxlngtlat&lng='+e.point.lng+'&lat='+e.point.lat+'&random=@random@&datatype=json'; 
						$.ajax({
						 type: 'post',
						 async:false, 
						 url: url.replace('@random@', 1+Math.round(Math.random()*1000)), 
						 dataType: 'json',success: function(content) {   
							if(content.error == false){ 
							// alert( content.msg.store_num);
							  shuliang = content.msg.store_num;
						  
						  if(shuliang > 0){
							    var newpoint = new BMap.Point(content.msg.lng, content.msg.lat);  
								  //savemapurl  encodeURI
								  var temp_linksss = savemapurl.replace('@lat@',content.msg.lat).replace('@lng@', content.msg.lng).replace('@mapname@', encodeURI(content.msg.region_addr));
								 
									var contentm = '<p class="infoTitle">'+content.msg.region_name+'</p><p class="infoAddress">'+content.msg.region_addr+'</p><p class="nearshop">附近共有<span class="shopnum" > '+shuliang+' </span>家商家</p>';
												 if(shuliang > 0){
													contentm += '<a href="'+temp_linksss+'" class="mapBtns">查看商家</a>';
												 }
											   
												   var NewinfoWindow = new BMap.InfoWindow(contentm); 
								  
								  
								 // var NewinfoWindow = new BMap.InfoWindow(contentc);   
								
								 marker = new BMap.Marker(newpoint,{icon:myIcon1});
							
								   map.openInfoWindow(NewinfoWindow,newpoint);  
								  $('#cityname').val(content.msg.city); 
								  if(makenow ==  false){
											makenow = true;
										   map.addOverlay(marker);
								  }
							  } else{
							
										 shuliang = content.msg.store_num;
								 
										var newpoint = new BMap.Point(content.msg.lng, content.msg.lat);  
										  //savemapurl  encodeURI
										  var temp_linksss = savemapurl.replace('@lat@',content.msg.lat).replace('@lng@', content.msg.lng).replace('@mapname@', encodeURI(content.msg.region_addr));
										 
											var contentm = '<p class="infoTitle">'+content.msg.region_name+'</p><p class="infoAddress" style="height:34px; line-height:34px;">'+content.msg.region_addr+'</p>';
											 

													contentm += '<a  style="background:#b5b5b5; color:#fff;" href="javascript:void(0);" class="mapBtns">努力覆盖中...</a>';
										
											 var NewinfoWindow = new BMap.InfoWindow(contentm); 
										  
										  
										 // var NewinfoWindow = new BMap.InfoWindow(contentc);   
										
										 marker = new BMap.Marker(newpoint,{icon:myIcon1});
									
										   map.openInfoWindow(NewinfoWindow,newpoint);  
										  $('#cityname').val(content.msg.city); 
										  if(makenow ==  false){
													makenow = true;
												   map.addOverlay(marker);
										  }
									  
							  
							  
								
							}
							  
							  
							  
							  
							} else{
							
										 shuliang = content.msg.store_num;
								//  alert(shuliang);
										var newpoint = new BMap.Point(content.msg.lng, content.msg.lat);  
										  //savemapurl  encodeURI
										  var temp_linksss = savemapurl.replace('@lat@',content.msg.lat).replace('@lng@', content.msg.lng).replace('@mapname@', encodeURI(content.msg.region_addr));
										 
											var contentm = '<p class="infoTitle">'+content.msg.region_name+'</p><p class="infoAddress">'+content.msg.region_addr+'</p>';
														 if(shuliang > 0){
															contentm += '<a href="javascript:void(0);" class="mapBtns" style="background:#ccc; color:#fff;">努力覆盖中</a>';
														 }
													   
														   var NewinfoWindow = new BMap.InfoWindow(contentm); 
										  
										  
										 // var NewinfoWindow = new BMap.InfoWindow(contentc);   
										
										 marker = new BMap.Marker(newpoint,{icon:myIcon1});
									
										   map.openInfoWindow(NewinfoWindow,newpoint);  
										  $('#cityname').val(content.msg.city); 
										  if(makenow ==  false){
													makenow = true;
												   map.addOverlay(marker);
										  }
									  
							  
							  
								
							}
							},
						error: function(content) { 


						alert('获取失败，可以尝试刷新重试！'); 
						
						
						
						
						}
					   });  
 
					
			
			//		$.getScript('http://api.map.baidu.com/geocoder/v2/?ak=<{$baidumapkey}>&callback=renderReverse&location='+e.point.lat+','+e.point.lng+'&output=json&pois=1');   
					
			}
	} 
});

function renderReverse(datas){
/*	 if(datas.status == 0){  
	 	  var  shuliang = 0;
	    var url = siteurl+'/index.php?ctrl=site&action=ajaxlngtlat&lng='+datas.result.location.lng+'&lat='+datas.result.location.lat+'&random=@random@&datatype=json'; 
	    $.ajax({
         type: 'post',
         async:false, 
         url: url.replace('@random@', 1+Math.round(Math.random()*1000)), 
         dataType: 'json',success: function(content) {   
         	if(content.error == false){ 
            // alert( content.msg.store_num);
              shuliang = content.msg.store_num;
         	} 
	    	},
        error: function(content) {   alert('shiba'); }
       });  
 
	      var newpoint = new BMap.Point(datas.result.location.lng, datas.result.location.lat);  
	      //savemapurl  encodeURI
	      var temp_linksss = savemapurl.replace('@lat@',datas.result.location.lat).replace('@lng@', datas.result.location.lng).replace('@mapname@', encodeURI(datas.result.formatted_address));
	     
	
		  
		    var contentm = '<p class="infoTitle">'+datas.result.business+'</p><p class="infoAddress">'+datas.result.formatted_address+'</p><p class="nearshop">附近共有<span class="shopnum"> '+shuliang+' </span>家商家</p>';
         		         if(shuliang > 0){
         		            contentm += '<a href="'+temp_linksss+'" class="mapBtns">查看商家</a>';
         		         }
         		       
         		    	   var NewinfoWindow = new BMap.InfoWindow(contentm); 
		  
		  
	     // var NewinfoWindow = new BMap.InfoWindow(contentc);   
	      if(makenow ==  false){ 
	   	          marker = new BMap.Marker(newpoint,{icon:myIcon1});
        }else{
     	           marker.setPosition(newpoint);  
	      } 
	      
	       map.openInfoWindow(NewinfoWindow,newpoint);  
	      $('#cityname').val(datas.result.addressComponent.city); 
	      if(makenow ==  false){
	  	            makenow = true;
	               map.addOverlay(marker);
	      }
	 }else{  
	 } 
	 */
}



$("#searchKeywords").keyup(function(){

	if(biaoqianval == false){
		biaoqianval  = true;

			 setTimeout("bqzhi()", 500 ); 
			 
			 
			 
			  if(event.keyCode ==13){
				$("#tangram-suggestion--TANGRAM__2-main").hide();
				var searchval = $("#searchKeywords").val();
				if( searchval == '' ){
					$(".dialog-failed").show();
					$(".mask").show();
				}else{
					$("#guider").hide();
					//position: absolute; top: 0px; left: 0px;
					$("#address").css("position","absolute");
					$("#address").animate({top:"0px",left:"0px"}, 'slow');			
					$("#search_result").removeClass("hidden");
					$("#bd-map").removeClass("hidden");
					//local.search(searchval);
					//	$("#tangram-suggestion--TANGRAM__2-main").css("top","141px");
					///	$("#tangram-suggestion--TANGRAM__2-main").css("left","355px");
					$("#tangram-suggestion--TANGRAM__2-main").css("top","230px");
				$("#tangram-suggestion--TANGRAM__2-main").css("left","353px");
				$(".map").css('height','600px');
				$(".guidebox").css('height','850px');
						
					dosearchmap(0);
				}
			}else{
				 
			 
			 
			 
			 
			 
						var searchval  = $("#searchKeywords").val();
				
						$.ajax({
							url: '<{$siteurl}>/index.php?ctrl=site&action=getsearmap&datatype=json',
							data: 'searchvalue=' + encodeURI(searchval),
							dataType: "json",
							success: function(content) {  
								
								$("#tangram-suggestion--TANGRAM__2-main").show();
								$("#tangram-suggestion--TANGRAM__2-main #tangram-suggestion--TANGRAM__2 table tbody").html('');
								
							//	alert(content.msg.length);
								var tempaddc = content.msg.length;
								if(content.msg.length > 0 ){
									for(var i=0;i<tempaddc;i++){
												//	alert(	content.msg[i].datacontent );		   
						$('#tangram-suggestion--TANGRAM__2-main #tangram-suggestion--TANGRAM__2 table tbody').append('<tr><td id="tangram-suggestion--TANGRAM__2-item0"  class=""><i class="route-icon">'+content.msg[i].datacontent+'&nbsp;<span class="tangram-suggestion-grey">'+content.msg[i].dataaddress+'</span></i></td></tr>');
										  
									 } 
								 }
								 else{
								 
	// $('#tangram-suggestion--TANGRAM__2-main #tangram-suggestion--TANGRAM__2 table tbody').append('<tr><td id="tangram-suggestion--TANGRAM__2-item0"  class=""><i class="route-icon"><span class="tangram-suggestion-grey">未获取到该地址，请换个关键字尝试下...</span></i></td></tr>');

			$("#tangram-suggestion--TANGRAM__2-main").hide();					 }
								  //   $('#search_result .pager').append('<a  onclick="dosearchmap('+i+');" data-page="'+i+'" href="javascript:;" class="active">'+c+'</a>');
							
								
								bindsearch();
							
							}
						});
			}
	
	}
	
});
function bindsearch(){
	$("#tangram-suggestion--TANGRAM__2 table tbody tr").click(function(){
		$("#searchKeywords").val( $(this).text() );
		$("#tangram-suggestion--TANGRAM__2-main").hide();
	});
}

$("#historylist").click(function(){
	$(".dialog-historyaddr").toggle();
});

</script>
<style>
	#search_result  li:hover{background-color: #EEEEEE;}
</style>

<div class="tangram-suggestion-main" id="tangram-suggestion--TANGRAM__2-main" data-guid="TANGRAM__2" style="position: absolute; display:none ;z-index:10; left: 635px; top: 340px; width: 478px;">

	<div style="position: absolute; top: 0px; left: 0px; width: 480px; height: 323px;">
		<iframe src="javascript:void(0)" frameborder="0" scrolling="no" height="97%" style="width: 480px; z-index: -1; display: block; border: 0px;"></iframe>
	</div>
	<div id="tangram-suggestion--TANGRAM__2" class="tangram-suggestion" style="position:relative; top:0px; left:0px">
		<table cellspacing="0" cellpadding="2" style="width:100%;">
			<tbody>
				
			</tbody>
		</table>
	</div>
</div>

<script type="text/javascript">
	$(function(){ 
	$("#search_result  li").hover(function(){
		$(this).addClass("over");
		},function(){
		$(this).removeClass("over");
	});
});
	
</script>


	<style>
.infoTitle{ font-size:14px; color:#000000; height:20px; line-height:20px;}
.infoAddress{font-size:14px; color:#959595;}
.nearshop{font-size:14px; color:#000000; height:34px; line-height:34px;}
.shopnum{ color:#fe4d3d;}
.mapBtns{ background:#00a0e9; font-size:16px; font-weight:bold; color:#fff;  padding:3px 10px; }
</style>
	
</body>

</html>
